/**
 * session 登录验证中间件
 */

function checklogin(req, res, next) {
   if (!req.session.uname) {
      res.send(`<script>alert('请先登录');window.location.href='/login'</script>`)
      return
   }
   next()
}
module.exports = checklogin